home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20000217-20000824 / 000042_news@columbia.edu _Wed Feb 23 15:10:31 2000.msg < prev    next >
Internet Message Format  |  2020-01-01  |  4KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id PAA22210
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Wed, 23 Feb 2000 15:10:31 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id OAA27416
  7.     for kermit.misc@watsun.cc.columbia.edu; Wed, 23 Feb 2000 14:51:20 -0500 (EST)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Subject: Re: Array name passed to macro as argument?
  11. Date: 23 Feb 2000 19:51:19 GMT
  12. Organization: Columbia University
  13. Message-ID: <891dnn$qol$1@newsmaster.cc.columbia.edu>
  14. To: kermit.misc@columbia.edu
  15.  
  16. In article <Jf10IGSklAzn@cc.usu.edu>, Joe Doupnik <jrd@cc.usu.edu> wrote:
  17. :     Just a comment from the trenches on this item. The fancier notation
  18. : used by Frank is nifty. However when it comes to implementing it in
  19. : assembler within a small space for a DOS program and inside of especially
  20. : complex code for parsing, then things are sticky. Thus I decided to not
  21. : implement the dot semicolon-equal etc material as there are equivalent
  22. : ways of accomplishing the goal. Appologies for the inconvience of having
  23. : two ways of doing this.
  24. :     Joe D.
  25. :
  26. MS-DOS Kermit, C-Kermit, and K95 are different programs that are written in
  27. and for different development and operating environments.  When comparing
  28. these three Kermit programs, remember:
  29.  
  30.  . C-Kermit (in the general case) and K95 are developed in and for "large
  31.    memory" environments, whereas MS-DOS Kermit is painstakingly
  32.    constructed for the traditional memory-constrained environment (640K,
  33.    less space needed for DOS, running an external shell, etc) where there
  34.    is not as much room for features.
  35.  
  36.  . MS-DOS Kermit (at least when you run it in DOS) can do things that K95
  37.    and C-Kermit can not do, because it has direct access to the hardware:
  38.    communications port, video adapter, keyboard, etc.  C-Kermit and K95
  39.    are not allowed this kind of access, and therefore can never do certain
  40.    things that MS-DOS Kermit can.
  41.  
  42. C-Kermit and K95 have compatible script languages because they share common
  43. code.  MS-DOS Kermit is a separate code base, and there are some language
  44. differences.  We have made an attempt at enumerating these in:
  45.  
  46.   http://www.columbia.edu/kermit/scriptref.html
  47.  
  48. Corrections, additions, suggestions welcome.
  49.  
  50. The addition of C-like (well, really more Bliss-like) ".variable = value"
  51. notation to C-Kermit and K95 was not just to make the Kermit language look
  52. more natural to programmers, but also to add a certain clarity.  For those
  53. who haven't encountered this notation before, here's how it goes:
  54.  
  55.  .variable = string
  56.     This is equivalent to "define variable string",
  57.     i.e. set the variable's value to the string on the right hand side
  58.  
  59.  .variable := string
  60.     This is equivalent to "assign variable string",
  61.     i.e. set the variable's value to the VALUE of the string on the 
  62.     right hand side.
  63.  
  64.  .variable ::= string
  65.     Here the string is assumed to be a mathematical expression.  First it
  66.     is evaluated in the Kermit sense (variables expanded, etc), and then
  67.     it is evaluated in the arithmetic sense, and the result is assigned
  68.     to the variable.
  69.  
  70. To illustrate:
  71.  
  72.    Statement                   Result          Portable method
  73.     .\%a = 1                     1              define \%a 1
  74.     .\%b = 2                     2              define \%b 2
  75.     .sum = \%a + \%b         \%a + \%b          define sum \%a + \%b
  76.     .sum := \%a + \%b          1 + 2            assign sum \%a + \%b
  77.     .sum ::= \%a + \%b           3              assign sum \feval(\%a + \%b)
  78.  
  79. As new features like this (and this only one of many) are added to K95 and
  80. C-Kermit, increasing care must be taken by those who want to write scripts
  81. that also execute in MS-DOS Kermit.  The script reference mentioned above
  82. shows you which features you can use in which versions of each program.
  83.  
  84. - Frank